package com.jacobson.core.widget.security

/**
 * ================================================
 *
 *  @author Wucz on 2018/8/6 10:52
 * ================================================
 */
object SecurityStorage {
    private var subject: Subject? = null
    private lateinit var securityManager: SecurityManager
    internal var authenticated: Boolean = false
    internal var principal: Any? = null

    internal fun getSubject(): Subject? = subject

    internal fun bindSubject(subject: Subject): Subject? {
        this.subject = subject
        return subject
    }

    internal fun getSecurityManager(): SecurityManager = securityManager

    internal fun init(securityManager: SecurityManager) {
        this.securityManager = securityManager
    }
}